import React from 'react'
import { Button } from 'antd'
import {  } from 'react-router-dom'

let btns = React.createElement(Button, {value: 12, color: 'red'}, '按钮')


export default class Home extends React.Component {
  constructor(props) {
    super(props)
    this.goBack = this.goBack.bind(this)
    this.domRef = React.createRef()
  }

  componentDidMount () {
    this.domRef.current.classList.add('active')
    document.title = 'home页面'
    console.log(window.document, window, 'query')
  }

  goBack () {
    this.props.history.push('/')
  }


  render () {
    return (
      <div className="home" ref={this.domRef}>这是home首页
      <Button type="primary" onClick={this.goBack}>返回</Button>
      {
        btns
      }
      </div>
    )
  }
}